// import mongoose from "mongoose"
// 用户模型
const mongoose = require('mongoose')
const Schema = mongoose.Schema;
const UserSchema = new Schema({
  // 用户名
  username:{
    type: String,
    unique: true,
    require: true
  },
  //   密码
  password: {
    type: String,
    require: true
  },
  //   邮箱
  email: {
    type: String,
    require: true
  }
})

// export default mongoose.model("User", UserSchema);
mongoose.set('useCreateIndex', true);
module.exports = mongoose.model("User", UserSchema);
